package com.ie.cloud.payment.task;

import com.ie.cloud.payment.service.impl.PayOrderFlowRecordServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.time.LocalDate;

/**
 * Created with FR
 *
 * @Author: DQ
 * @Date: 2025/07/22/19:54
 * @Description: 流水记录抓取任务
 */
@Slf4j
@Component
public class PayOrderFlowRecordTask{

    @Resource
    private PayOrderFlowRecordServiceImpl payOrderFlowRecordService;


    //0 0 */1 * * *" 1 hour
    @Scheduled(cron = "0 0 * * * *")
    public void start() {
        LocalDate now = LocalDate.now();

        log.info("开始抓取流水记录 {}", now);


        payOrderFlowRecordService.pullFlowRecord(now.toString());

        log.info("结束抓取流水记录 {}", now);
    }

}
